/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package persistence;
import persistence.ConnectionFactory;
import model.Conserto;
import java.sql.*;
import java.sql.PreparedStatement;

/**
 *
 * @author Clau
 */
public class ConsertoDAO extends Dao{
    private final Connection connection;
    private String pedido;
    private String descricaoConserto;
    private Date dataRealConserto;

    public ConsertoDAO(){
     this.connection = new ConnectionFactory().getConnection();
}
    
    
    public void adiciona (Conserto conserto) throws SQLException{
         stmt = con.prepareStatement( "INSERT INTO conserto(pedido,descricaoconserto,datarealpedido) VALUES(?,?,?)");
         try{
             stmt.setString(1, conserto.getPedido());
             stmt.setString(2, conserto.getDescricaoConserto());
             stmt.setDate(3, (Date) conserto.getDataRealConserto());
             
         } catch (SQLException u){
             throw new RuntimeException(u);
         }
    }


}
